home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / python-support / python2.6 / gdata / client.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  3.7 KB  |  78 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __author__ = 'j.s@google.com (Jeff Scudder)'
  5. import atom.client as atom
  6. import urllib
  7. import urlparse
  8. import gdata.auth as gdata
  9. import gdata.service as gdata
  10. import atom.service as atom
  11.  
  12. class GDClient(atom.client.AtomPubClient):
  13.     pass
  14.  
  15. SCOPE_URL_PARAM_NAME = gdata.service.SCOPE_URL_PARAM_NAME
  16. CLIENT_LOGIN_SCOPES = gdata.service.CLIENT_LOGIN_SCOPES
  17.  
  18. class AuthorizationRequired(gdata.service.Error):
  19.     pass
  20.  
  21.  
  22. class GDataClient(gdata.service.GDataService):
  23.     '''This class is deprecated. 
  24.   
  25.   All functionality has been migrated to gdata.service.GDataService.
  26.   '''
  27.     
  28.     def __init__(self, application_name = None, tokens = None):
  29.         gdata.service.GDataService.__init__(self, source = application_name, tokens = tokens)
  30.  
  31.     
  32.     def ClientLogin(self, username, password, service_name, source = None, account_type = None, auth_url = None, login_token = None, login_captcha = None):
  33.         gdata.service.GDataService.ClientLogin(self, username = username, password = password, account_type = account_type, service = service_name, auth_service_url = auth_url, source = source, captcha_token = login_token, captcha_response = login_captcha)
  34.  
  35.     
  36.     def Get(self, url, parser):
  37.         """Simplified interface for Get.
  38.  
  39.     Requires a parser function which takes the server response's body as
  40.     the only argument.
  41.  
  42.     Args:
  43.       url: A string or something that can be converted to a string using str.
  44.           The URL of the requested resource.
  45.       parser: A function which takes the HTTP body from the server as it's
  46.           only result. Common values would include str, 
  47.           gdata.GDataEntryFromString, and gdata.GDataFeedFromString.
  48.  
  49.     Returns: The result of calling parser(http_response_body).
  50.     """
  51.         return gdata.service.GDataService.Get(self, uri = url, converter = parser)
  52.  
  53.     
  54.     def Post(self, data, url, parser, media_source = None):
  55.         """Streamlined version of Post.
  56.  
  57.     Requires a parser function which takes the server response's body as
  58.     the only argument.
  59.     """
  60.         return gdata.service.GDataService.Post(self, data = data, uri = url, media_source = media_source, converter = parser)
  61.  
  62.     
  63.     def Put(self, data, url, parser, media_source = None):
  64.         """Streamlined version of Put.
  65.  
  66.     Requires a parser function which takes the server response's body as
  67.     the only argument.
  68.     """
  69.         return gdata.service.GDataService.Put(self, data = data, uri = url, media_source = media_source, converter = parser)
  70.  
  71.     
  72.     def Delete(self, url):
  73.         return gdata.service.GDataService.Delete(self, uri = url)
  74.  
  75.  
  76. ExtractToken = gdata.service.ExtractToken
  77. GenerateAuthSubRequestUrl = gdata.service.GenerateAuthSubRequestUrl
  78.